package beans;

import core.School;
import db.JDBC.core.SchoolJdbcDAOCore;
import javax.annotation.PostConstruct;
import javax.faces.context.FacesContext;



/**
 *
 * @author Anton
 */

public class SchoolBean extends BaseBean
{
    private Long id;
    private School school;

    @PostConstruct
    public void init()
    {
        String getId = (String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id");
        if(getId == null)
            return;
        id = new Long(getId);
        if(id != null)
            school = SchoolJdbcDAOCore.getInstance().getSchoolById(id);
    }

    public Long getId()
    {
        return id;
    }

    public School getSchool()
    {
        System.out.println("ja");
        return school;
    }
}
